package com.sinosoft.emplmis.jobless.manager.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.github.pagehelper.PageHelper;
import com.sinosoft.emplmis.jobless.dao.JoblessInfoEntityMapper;
import com.sinosoft.emplmis.jobless.entity.JoblessInfoEntity;
import com.sinosoft.emplmis.jobless.manager.JoblessInfoManager;
import com.sinosoft.emplmis.jobless.web.dto.JoblessInfoData;
import com.sinosoft.emplmis.jobless.web.dto.JoblessSearchData;

public class JoblessInfoManagerImpl implements JoblessInfoManager {

	/**
	 * 失业人员基本信息
	 */
	private JoblessInfoEntityMapper joblessInfoEntityMapper;

	public JoblessInfoEntityMapper getJoblessInfoEntityMapper() {
		return joblessInfoEntityMapper;
	}

	public void setJoblessInfoEntityMapper(
			JoblessInfoEntityMapper joblessInfoEntityMapper) {
		this.joblessInfoEntityMapper = joblessInfoEntityMapper;
	}
	
	@Override
	public int deleteByPrimaryKey(String unemployedId) {
		Logger.getRootLogger().info("根据主键删除失业人员信息");
		return joblessInfoEntityMapper.deleteByPrimaryKey(unemployedId);
	}
	
	@Override
	public int auditSubmitInfo(String unemployedId) {
		Logger.getRootLogger().info("根据主键提交放弃求职人员的申请");
		return joblessInfoEntityMapper.auditSubmitInfo(unemployedId);
	}
	
	@Override
	public int auditGiveupInfo(String unemployedId) {
		Logger.getRootLogger().info("根据主键审核放弃求职人员的申请");
		return joblessInfoEntityMapper.auditGiveupInfo(unemployedId);
	}
	
	@Override
	public int giveupRemove(String unemployedId) {
		Logger.getRootLogger().info("根据删除放弃求职人员的申请");
		return joblessInfoEntityMapper.giveupRemove(unemployedId);
	}
	
	@Override
	public JoblessInfoEntity selectByPrimaryKey(String unemployedId) {
		Logger.getRootLogger().info("根据主键获取劳动力信息");
		return joblessInfoEntityMapper.selectByPrimaryKey(unemployedId);
	}

	@Override
	public List<JoblessInfoEntity> selectAll(JoblessSearchData data) {
		Logger.getRootLogger().info("获取失业人员信息");
		PageHelper.startPage(data.getPage(), data.getRows());
    	return joblessInfoEntityMapper.selectAll(data);

	}
	
	@Override
	public int insert(JoblessInfoEntity record) {
		Logger.getRootLogger().info("添加失业人员信息");
		return joblessInfoEntityMapper.insert(record);
	}
	
	@Override
	public int updateByPrimaryKey(JoblessInfoEntity record) {
		Logger.getRootLogger().info("更新失业人员信息");
		return joblessInfoEntityMapper.updateByPrimaryKey(record);
	}
	
	@Override
	public int updateJoblessGiveup(JoblessInfoEntity record) {
		Logger.getRootLogger().info("更新放弃求职人员信息");
		return joblessInfoEntityMapper.updateJoblessGiveup(record);
	}
	
	@Override
	public int updateDifficulty(JoblessInfoEntity record) {
		Logger.getRootLogger().info("更新困难人员信息");
		return joblessInfoEntityMapper.updateDifficulty(record);
	}
	
	@Override
	public List<JoblessInfoEntity> difficultyInfoList(JoblessSearchData data) {
		Logger.getRootLogger().info("获取困难人员信息");
		PageHelper.startPage(data.getPage(), data.getRows());
		return joblessInfoEntityMapper.difficultyInfoList(data);
	}
	
	@Override
	public List<JoblessInfoEntity> historyDifficultyInfoList(JoblessSearchData data) {
		Logger.getRootLogger().info("获取历史困难人员信息");
		return joblessInfoEntityMapper.historyDifficultyInfoList(data);
	}
	
	@Override
	public List<JoblessInfoEntity> joblessRealizeList(JoblessSearchData data) {
		Logger.getRootLogger().info("获取当年实现就业人员信息");
		PageHelper.startPage(data.getPage(), data.getRows());
		return joblessInfoEntityMapper.joblessRealizeList(data);
	}

	@Override
	public List<JoblessInfoEntity> joblessReduceList(JoblessSearchData data) {
		Logger.getRootLogger().info("获取失业人员客观原因减少信息");
		PageHelper.startPage(data.getPage(), data.getRows());
		return joblessInfoEntityMapper.joblessReduceList(data);
	}
	
	@Override
	public List<JoblessInfoEntity> joblessGiveupList(JoblessSearchData data) {
		Logger.getRootLogger().info("获取放弃求职人员减少申报信息");
		PageHelper.startPage(data.getPage(), data.getRows());
		return joblessInfoEntityMapper.joblessGiveupList(data);
	}

	@Override
	public int count(JoblessSearchData data) {
		Logger.getRootLogger().info("获取失业人员总条目数");
		return joblessInfoEntityMapper.count(data);
	}

	@Override
	public int countDifficulty(JoblessSearchData data) {
		Logger.getRootLogger().info("获取困难人员总条目数");
		return joblessInfoEntityMapper.countDifficulty(data);
	}
	
	@Override
	public int countHistoryDifficulty(JoblessSearchData data) {
		Logger.getRootLogger().info("获取历史困难人员总条目数");
		return joblessInfoEntityMapper.countHistoryDifficulty(data);
	}

	@Override
	public int countrealjob(JoblessSearchData data) {
		Logger.getRootLogger().info("获取当年实现就业总条目数");
		return joblessInfoEntityMapper.countrealjob(data);
	}

	@Override
	public int countremovereason(JoblessSearchData data) {
		Logger.getRootLogger().info("获取客观原因减少总条目数");
		return joblessInfoEntityMapper.countremovereason(data);
	}

	@Override
	public int countgiveup(JoblessSearchData data) {
		Logger.getRootLogger().info("获取放弃求职总条目数");
		return joblessInfoEntityMapper.countgiveup(data);
	}

}
